using System;
using System.Collections.Generic;
using System.Text;

namespace Zsa.Emulation.Cartridge
{
    /// <summary>
    /// Throw when there is invalid data in cartridge header.
    /// </summary>
    public class InvalidCartridgeHeaderException : CartridgeException

    {
        /// <summary>
        /// Initializes a new instance of the <see cref="T:InvalidCartridgeHeaderException"/> class.
        /// </summary>
        /// <param name="message">The message.</param>
        public InvalidCartridgeHeaderException(string message)
            : this (string.Empty,string.Empty,message,null)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="T:InvalidCartridgeHeaderException"/> class.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="value">The value.</param>
        public InvalidCartridgeHeaderException(string name,
            object value)
            : this(name, value, string.Empty, null)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="T:InvalidCartridgeHeaderException"/> class.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="value">The value.</param>
        /// <param name="message">The message.</param>
        public InvalidCartridgeHeaderException(string name,
            object value, string message)
            : this(name, value, message, null)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="T:InvalidCartridgeHeaderException"/> class.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="value">The value.</param>
        /// <param name="message">The message.</param>
        /// <param name="excep">The excep.</param>
        public InvalidCartridgeHeaderException(string name,
            object value, string message, Exception excep)
            : base(message + string.Format("  Name : {0}.  Value : {1}", name.ToString(), value), excep)
        {
            base.Data.Add("Name", name);
            base.Data.Add("Value", value.ToString());
        }


    }
}
